var mydata = null;
Highcharts.setOptions({
    global: {
        useUTC: false
    }
});
var options = {
    chart: {
        type: 'spline',
        renderTo: 'main',
        // animation: Highcharts.svg,
        animation: false,
        backgroundColor:'#000000',
        marginRight: 20,
        zoomType: 'x',
        panning: true,
        panKey: 'shift',     /*平移键，默认是 “Shift”*/

        events: {
            load: function () {//load表示的是在图表加载完时触发
                var series = this.series[0],
                    chart = this;
            }
        }
    },

    title: {
        text: ''
    },

    xAxis: {
        type: 'datetime',
        tickPixelInterval: 100,//设置刻度间隔 。该参数对分类坐标轴无效。对于 Y 轴，其默认值是72，X 轴则是 100

        labels:{
            enabled:false
        },
        lineWidth: 0,  //去掉x轴线
        tickWidth: 0,   //去掉刻度
    },

    yAxis:{
        title:{
            text:''
        },
        labels:{
            enabled:false
        },
        gridLineWidth: 0,
        // tickInterval:200,
        max:2,
        min:-1
    },

    credits:{
        enabled:false
    },

    //数据点信息
    plotOptions: {
        series: {
            marker: {
                enabled: false, /*数据点是否显示，不显示则为一条线*/
            },
        },
    },

    legend: {
        enabled: false
    },

    series: [{
        name: '',
        color:'#33ff33',
        // data: [].
        //传入数据
        data: SerialData
    }]
}


$(function () {

    // 图表初始化函数
    var chart = Highcharts.chart('container', options);

});

//最新的数据加上标识框Toolip
function activeLastPointToolip(chart) {
    var points = chart.series[0].points;
    chart.tooltip.refresh(points[points.length -1]);
}

function a() {
    for (var i=0;i<10;i++){
        if (chart.data.length) {
                console.log(chart.data.length)
            chart.data=array[i]
        }
    }
}
